package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {

    /**
     * 判断当前菜品是否被套餐关联
     *
     * @param ids
     * @return
     */
    List<Long> getSetmealIdsByDishIds(List<Long> ids);

    /**
     * 新增套餐关联的菜品
     *
     * @param setmealDishes
     */
    void insert(List<SetmealDish> setmealDishes);

    /**
     * 删除套餐关联的菜品
     *
     * @param setmealId
     */

    @Delete("delete from setmeal_dish where  setmeal_id = #{setmealId}")
    void deleteBySetmealId(Long setmealId);

}
